package com.epam.Reptile;

public class Tortoise extends Reptile {

    public Tortoise(String name, int size, double price, int numberOfLimbs, char sex) {
        super(name, size, price, numberOfLimbs);

        this.sex = sex;
    }

    private char sex;

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        if(sex == 'M' || sex =='F'){
            this.sex = sex;
        }
    }

    @Override
    public void eat() {
        System.out.println("Tortoise eating");
        hunger--;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public void swim() {
        System.out.println("Tortoise swimming");
        hunger++;
        System.out.println("Hunger: " + hunger);
    }

    @Override
    public String toString() {
        return "Tortoise [ Name: "+getName()+"; Price: "+getPrice()+"; Size:"+ getSize()+
                "; Sex: "+getSex()+"]";
    }


}
